<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>websocket聊天室</title>
    <style>
        .message {
            width: 300px;
            height: 500px;
            border: 2px solid red;
        }
    </style>
</head>
<body>
<div class="message"></div>
<div>
    <input type="text" id="txt" placeholder="输入你要发送的内容">
    <input type="button" value="发送" onclick="sendmessage();">
</div>

<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
    socket = new WebSocket("ws://127.0.0.1:8000/room/123/")
</script>
</body>
</html>